package logicQuiz

import org.springframework.cloud.contract.spec.Contract

Contract.make {
    request {
        method("POST")
        url("/api/v3/logicQuizzesItem/submission")
        body("""
            {
                "id":1,
                "answer":"answer"
            }
            """)
        bodyMatchers {
            jsonPath('$.id', byRegex(number()))
            jsonPath('$.answer', byRegex("[\\s\\S]+"))
        }
        headers {
            contentType(applicationJsonUtf8())
        }
    }
    response {
        status(201)
    }
}
